mf = open(r'D:\code.txt', 'r', encoding='utf-8')
# 处理每行内容
for line in mf:
    print(line.strip())  # 输出行，并去除首尾的空格和换行符
mf.close()  # 关闭文件